package cn.itcast.service.impl;


import cn.itcast.dao.SetmealDao;
import cn.itcast.entity.Result;
import cn.itcast.pojo.Address;
import cn.itcast.service.AddressService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import cn.itcast.dao.AddressDao;


import java.util.List;


@Service
public class AddressServiceImpl implements AddressService {


    @Autowired
    private SetmealDao setmealDao;
    /**
     * 查询预约分院下拉框
     * @return
     */
    @Override
    public List<Address> findAllAddress() {

        return setmealDao.findAllAddress();
    }

    @Autowired
    private AddressDao addressDao;

    //查询所有分院address
    @Override
    public Result findAll() {
        List<Address> list = addressDao.findAll();

        if (list != null){
            return new Result(true,"查询成功",list);
        }else{
            return new Result(false,"查询失败",null);
        }
    }
}
